import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/home/index.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      isGoBack: false,
      isMenu: true,
      title: '首页'
    },
  },
  {
    path: '/details',
    name: 'Details',
    meta: {
      isGoBack: false,
      isMenu: true,
      title: '大赛详情'
    },
    component: () => import(/* webpackChunkName: "Details" */ '../views/details/index.vue')
  },
  {
    path: '/explain',
    name: 'Explain',
    meta: {
      isGoBack: false,
      isMenu: true,
      title: '奖项说明'
    },
    component: () => import(/* webpackChunkName: "Explain" */ '../views/explain/index.vue')
  },
  {
    path: '/vote',
    name: 'vote',
    meta: {
      isGoBack: true,
      title: '参赛人投票',
      isMenu: true,
    },
    component: () => import(/* webpackChunkName: "vote" */ '../views/vote/index.vue'),
  },
  {
    path: '/report',
    name: 'Report',
    meta: {
      isGoBack: true,
      title: '大赛报道',
      isMenu: true,
    },
    component: () => import(/* webpackChunkName: "Report" */ '../views/report/index.vue'),
  },
  {
    path: '/member',
    name: 'member',
    meta: {
      isGoBack: true,
      title: '执行委员会',
      isMenu: true,
    },
    component: () => import(/* webpackChunkName: "member" */ '../views/member/index.vue'),
  },
  {
    path: '/roster',
    name: 'roster',
    meta: {
      isGoBack: true,
      title: '往届名单公示',
      isMenu: true,
    },
    component: () => import(/* webpackChunkName: "roster" */ '../views/roster/index.vue'),
  },
  {
    path: '/review',
    name: 'review',
    meta: {
      isGoBack: true,
      title: '往期回顾',
      isMenu: true,
    },
    component: () => import(/* webpackChunkName: "review" */ '../views/review/index.vue'),
  },
  {
    path: '/people',
    name: 'people',
    meta: {
      isGoBack: true,
      isMenu: false,
      title: '作品详情'
    },
    component: () => import(/* webpackChunkName: "people" */ '../views/people/index.vue')
  },
  {
    path: '/newsDetails',
    name: 'NewsDetails',
    meta: {
      isGoBack: true,
      isMenu: false,
      title: '新闻详情'
    },
    component: () => import(/* webpackChunkName: "NewsDetails" */ '../views/newsDetails/index.vue')
  },
  {
    path: '/searchRes',
    name: 'SearchRes',
    meta: {
      isGoBack: true,
      isMenu: false,
      title: '查询结果'
    },
    component: () => import(/* webpackChunkName: "SearchRes" */ '../views/searchRes/index.vue')
  },


]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
